check if the numbers have last digit same